
export function getFileIconName(typeId, fileName) {
  // 获取文件后缀
  const fileSuffix = fileName.substring(fileName.indexOf('.') + 1).toLowerCase()

  switch (typeId) {
    case 0:
      return 'cr-image'
    case 1:
      return 'cr-video'
    case 2:
      // "doc", "docx", "pdf", "txt", "rtf", "odt", "ott", "xls", "xlsx", "ppt", "pptx"
      if (fileSuffix === 'doc' || fileSuffix === 'docx') {
        return 'cr-word'
      } else if (fileSuffix === 'xls' || fileSuffix === 'xlsx') {
        return 'cr-xls'
      } else if (fileSuffix === 'ppt' || fileSuffix === 'pptx') {
        return 'cr-ppt'
      } else if (fileSuffix === 'pdf') {
        return 'cr-pdf'
      } else {
        return 'cr-txt'
      }
    case 3:
      return 'cr-audio'
    case 4:
      return 'cr-archive'
    case 5 :
      return 'cr-file'
    case 6 :
      return 'cr-folder'
    default:
      return 'cr-file'
  }
}

